using ProjectTemplate.API;

using Serilog;

using Tszy.Unlimited.AspNetCore;

try
{
    var builder = WebApplication.CreateBuilder(args);

    builder.Configure();
    builder.Services.AddControllers().ConfigureJson();

    var app = builder.Build();

    app.UseApp();
    app.MapControllers();

    app.Run();
}
catch (Exception ex)
{
    Log.Fatal(ex, "Host terminated unexpectedly");
}
finally
{
    Log.CloseAndFlush();
}